/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chess;
import   java.awt.*;
import   java.awt.event.*;

/**
 *
 * @author houfukude
 */
  //负责创建白色棋子的类;
class ChessPoint_white extends Canvas implements MouseListener{
      ChessPad   chesspad=null;
      ChessPoint_white(ChessPad p){
          setSize(20,20);addMouseListener(this);
          chesspad=p;
      }
    @Override
      public void paint(Graphics g)
      {
          g.setColor(Color.white);
          g.fillOval(0,0,14,14);
      }
    public void mousePressed(MouseEvent e){
        if(e.getModifiers()==InputEvent.BUTTON3_MASK)
        {
            chesspad.remove(this);
            chesspad.棋子颜色=-1;
            chesspad.text_2.setText("请白棋下子");
            chesspad.text_1.setText("");
        }
    }
    public   void   mouseReleased(MouseEvent   e){}
    public   void   mouseEntered(MouseEvent   e)   {}
    public   void   mouseExited(MouseEvent   e)   {}
    public   void   mouseClicked(MouseEvent   e){
        if(e.getClickCount()>=2)
            chesspad.remove(this);
    }
  }
